home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / hardware / fda / fda_update / install_fda-upd < prev    next >
Text File  |  2000-02-28  |  7KB  |  187 lines

  1. ;========================================================================================;
  2. ;=  $VER: 2.2 Future Drive Accelerator FullVersion Installscript by Martin Tauchmann    =;
  3. ;=  based on Update_MyProgram V1 written by Thomas Baust
  4. ;========================================================================================;
  5.  
  6. (set #Ver ("2.2"))
  7. (set #OldVer ("2.0"))
  8. (set #Demo ("Demo"))
  9.  
  10.  
  11. ;================================= ENGLISH ==================================;
  12.  
  13. (set languages-default 1)
  14.  
  15. (set #welc (cat "\n\nThis is a update for FDA\n"
  16.        "V 1.8-"#OldVer" Demo MC68020, to the "#Demo"-Version "#Ver".\n\n"
  17. ))
  18.  
  19. (set #whereprogFDA     ("Where is `FDA` installed ?\n\"SYS:WBStartup\" will be updated automaticly."))
  20. (set #whereprogFDAView ("Where is `FDAView` installed ?"))
  21. (set #whereprogFDAPref ("Where is `FDAPref` installed ?"))
  22. (set #whereprogFDAdoc  ("Choose the `FDAdoc` drawer ?"))
  23.  
  24. (set #helpwhereprog ("The MainDirectory of the Program, which will be updated."))
  25.  
  26. (set #patch1_1 (cat "\n\nNow, patching file `"))        ;Dateiname wird eingefügt
  27. (set #patch1_2 (cat "`\nfrom V"))                ;Alte Version wird eingefügt
  28. (set #patch1_3 (cat " to V"))                    ;Neue Version wird eingefügt
  29. (set #patch1_4 (cat " ."))
  30.  
  31. (set #ErrorMsg1_1 "\n\nError while patching file `")    ;Dateiname wird eingefügt
  32. (set #ErrorMsg1_2 "`.\n\n\n")
  33. (set #ErrorMsg1_21 "case 1 its alright the Version")        ;Neue Version wird eingefügt
  34. (set #ErrorMsg1_3 (cat " or higher"
  35.                "\ncase 2 this Version is not patchable... Are there files i.e. FDAV2.0?"))
  36. (set #ErrorMsg1_4 "can`t locate File. Are there files i.e. FDAV2.0?")
  37.  
  38.  
  39. ;===[ German Documentation ]=================================================
  40.  
  41. (if (= @language "deutsch")
  42.  (
  43. (set languages-default 2)
  44.  
  45. (set #welc (cat "\n\nDies ist ein Update für FDA\n"
  46.        "V 1.8-"#OldVer" Demo MC68020, zur "#Demo"-Version "#Ver".\n\n"
  47. ))
  48.  
  49. (set #whereprogFDA     ("In welchem Verzeichnis ist `FDA` installiert ?\n\"SYS:WBStartup\" wird automatisch geupdated."))
  50. (set #whereprogFDAView ("In welchem Verzeichnis ist `FDAView` installiert ?"))
  51. (set #whereprogFDAPref ("In welchem Verzeichnis ist `FDAPref` installiert ?"))
  52. (set #whereprogFDAdoc  ("Wähle das Verzeichnis `FDAdoc` aus ?"))
  53.  
  54. (set #helpwhereprog ("Das Hauptverzeichnis des Programmes, das upgedatet werden soll."))
  55.  
  56. (set #patch1_1 "\n\nJetzt wird die Datei `")        ;Dateiname wird eingefügt
  57. (set #patch1_2 "`\nvon V")                ;Alte Version wird eingefügt
  58. (set #patch1_3 " zur V")                    ;Neue Version wird eingefügt
  59. (set #patch1_4 " umgewandelt.")
  60.  
  61. (set #ErrorMsg1_1 "\n\nDas Patchen der Datei `")        ;Dateiname wird eingefügt
  62. (set #ErrorMsg1_2 "`\n ist fehlgeschlagen !!!\n\n\n")
  63. (set #ErrorMsg1_21 "Es ist bereits die Version ")        ;Neue Version wird eingefügt
  64. (set #ErrorMsg1_3 (cat " oder höher"
  65.                "\noder diese Version ist nicht Updateberechtigt...  Sind Files wie z.B. FDAV2.0 vorhanden?"))
  66. (set #ErrorMsg1_4 "File ist nicht ausfindig zu machen. Sind Files wie z.B. FDAV2.0 vorhanden?")
  67.  
  68.  )
  69. )
  70.  
  71. ;-------------------------------------------------
  72. ; Vergleiche Versionen, und patche die Datei
  73. ; Verzeichnis, Datei, Neue Versionsnummer
  74. ;-------------------------------------------------
  75. (procedure Update #dir #dat #nver
  76.  (set #dat2 (tackon #dir #dat))
  77.  
  78.  (working (cat #patch1_1 #dat #patch1_2 #OldVer #patch1_3 #nver #patch1_4))
  79.  (if (= (exists #dat2) 1)
  80.      (if (= (exists (cat #dat2 "V" #OldVer)) 0)
  81.         (COPYFILES    (SOURCE #dat2)
  82.                 (DEST #dat2)
  83.                 (NEWNAME (cat #dat2 "V" #OldVer))
  84.                 (PROMPT "Backup V" #OldVer)
  85.                 (SAFE)
  86.         )
  87.      )
  88.  )
  89.  (if (= (exists #dat2) 1)
  90.   (
  91.     (rename #dat2 (cat #dat2".old") (safe))
  92.     (set #cmd (cat "gpatch >\"CON:0/16/570/26/GPatch\" \""#dat2".old\" "#dat".patch \""#dat2 "\"" " RECURSIVE") )
  93.     (MESSAGE #cmd)
  94.     (set #patch (RUN #cmd (SAFE)))
  95.  
  96.     (if (> #patch 0) (rename (cat #dat2".old") #dat2 (safe)))
  97.     (if (> #patch 0)  (if (= (exists (cat #dat2 "V" #OldVer)) 1)
  98.                 (
  99.                     (set #cmd (cat "gpatch >\"CON:0/16/570/26/GPatch\" \""#dat2"V" #OldVer "\" "#dat".patch \""#dat2 "\"" " RECURSIVE") )
  100.                     (MESSAGE #cmd)
  101.                     (set #patch (RUN #cmd (SAFE)))
  102.                     (if (> #patch 0) (message (cat #ErrorMsg1_1 #dat #ErrorMsg1_2 #ErrorMsg1_21 #nver #ErrorMsg1_3) (ALL)) )
  103.                 )
  104.               )
  105.     )
  106.     (delete (cat #dat2".old") (safe))
  107.   )
  108.   (
  109.               (if (= (exists (cat #dat2 "V" #OldVer)) 1)
  110.                     (
  111.                         (set #cmd (cat "gpatch >\"CON:0/16/570/26/GPatch\" \""#dat2"V" #OldVer "\" "#dat".patch \""#dat2 "\"" " RECURSIVE") )
  112.                         (MESSAGE #cmd)
  113.                         (set #patch (RUN #cmd (SAFE)))
  114.                         (if (> #patch 0) (message (cat #ErrorMsg1_1 #dat #ErrorMsg1_2 #nver #ErrorMsg1_3) (ALL)) )
  115.                     )
  116.                     (
  117.                         (message (cat #ErrorMsg1_1 #dat #ErrorMsg1_2 #ErrorMsg1_4) (ALL))
  118.                     )
  119.               )
  120.   )
  121.  )
  122.  
  123. )
  124.  
  125. ;-------------------------------------------------
  126. ;Starte Update
  127. ;-------------------------------------------------
  128. (complete 0)
  129. (message #welc (ALL))
  130. (welcome)
  131.  
  132. ;-------------------------------------------------
  133. ;Frage nach Verzeichnis des Programmes
  134. ;-------------------------------------------------
  135. (set @default-dest (askdir (prompt #whereprogFDA) (help #helpwhereprog) (default "SYS:System/")))
  136. (complete 15)
  137.  
  138. ;-------------------------------------------------
  139. ;Update Hauptprogramm
  140. ;-------------------------------------------------
  141.  
  142. (Update @default-dest "FDA" #Ver)
  143. (complete 30)
  144. (set @default-dest (askdir (prompt #whereprogFDAView) (help #helpwhereprog) (DEFAULT @default-dest)))
  145.  
  146.     (IF (= (exists "SYS:WBStartup/FDA") 1)
  147.         (
  148.             (working "updating SYS:WBStartup")
  149.             (SET #cmd ("c:MakeLink SYS:WBStartup/%s %s%s" "FDA" @default-dest "FDA") )
  150.             (DELETE "SYS:WBStartup/FDA" (OPTIONAL "FORCE") (DELOPTS (SAFE) ))
  151.             (set #rc (RUN #cmd (SAFE)))
  152.             (if (> #rc 0)
  153.                 (
  154.                     (message "Link installing in \"SYS:WBStartup\" fails.\nNow copy a duplicate" (ALL))
  155.                     (COPYFILES (SOURCE (TACKON @default-dest "FDA"))
  156.                            (DEST "SYS:WBStartup")
  157.                            (safe)
  158.                     )
  159.                 )
  160.             )
  161.         )
  162.     )
  163. (DELETE (TACKON @default-dest "FDAV1.8") (OPTIONAL "FORCE") (DELOPTS (SAFE) (INFOS)))
  164. (complete 45)
  165. (Update @default-dest "FDAView" #Ver)
  166. (DELETE (TACKON @default-dest "FDAViewV1.8") (OPTIONAL "FORCE") (DELOPTS (SAFE) (INFOS)))
  167. (complete 60)
  168. (set @default-dest (askdir (prompt #whereprogFDAPref) (help #helpwhereprog) (default "SYS:Prefs/")))
  169. (complete 75)
  170. (Update @default-dest "FDAPref" #Ver)
  171. (DELETE (TACKON @default-dest "FDAPrefV1.8") (OPTIONAL "FORCE") (DELOPTS (SAFE) (INFOS)))
  172. (complete 90)
  173. (set @default-dest (askdir (prompt #whereprogFDAdoc) (help #helpwhereprog) (default "SYS:Prefs/FDAdoc")))
  174. (COPYFILES (SOURCE "/FDA-News.readme") (DEST @default-dest))
  175. (complete 100)
  176.  
  177. ;-------------------------------------------------
  178. ;Fertig...
  179. ;-------------------------------------------------
  180.  
  181. (IF (= (exists "/FDA-News.readme") 1)
  182.     (set #rc (RUN "RUN SYS:Utilities/MultiView /FDA-News.readme"))
  183. )
  184.  
  185. (exit)
  186.  
  187.